import instance from "@/config/axiosConfig.js";

const account = {
    queryAccountList: (params) => {
        return instance.get("/sys/account/list", {params}).then(res => {
            return res.data
        });
    },
    addAccount: (data) => {
        return instance.post("/sys/account/editAccount", data).then(res => {
            return res.data
        });
    },
    resetPassword: (id, menuId) => {
        return instance.put(`/sys/account/resetPassword/${id}`, {menuId}).then(res => {
            return res.data
        });
    },
    changeStatus: (id, data) => {
        return instance.put(`/sys/account/changeEnableStatus/${id}`, data).then(res => {
            return res.data
        });
    },
    changePassword: (data) => {
        return instance.put(`/sys/account/changePassword`, data).then(res => {
            return res.data
        });
    },
    delAccount: (params) => {
        return instance.delete(`/sys/account/${params.id}`, {params}).then(res => {
            return res.data
        });
    },
}

export default account;
